
#pragma once

#include "Infra/Thread.h"
#include <opencv2/opencv.hpp>

using namespace Dahua::Infra;
using namespace cv;

class ArmorDistinguish : public CThread{
public:
	ArmorDistinguish(StreamRetrievePtr& StreamData);
	bool start();
	void stop();
	Mat getOutputImage(){
		return outImage_;
	}
	Point2f* getVertices(){
		return vertices_;
	}
	int getCalculationCount(){
		return calculationCount_;
	}
	double getCalculationFps(){
		return calculationFps_;
	}
	bool getCalReady(){
		return calReady_;
	}
	void setOutputImage(Mat* src){
		outImage_ = src->clone();
	}
	void setCalReady(bool iReady){
		calReady_ = iReady;
	}
private:
	Mat outImage_;
	Point2f vertices_[4];
	void threadProc();
	void calFps();
	bool m_isLoop;
	double calculationFps_;
	int calculationCount_;
	bool calReady_;
	StreamRetrievePtr streamData;
};

typedef Dahua::Memory::TSharedPtr<ArmorDistinguish> ArmorDistinguishPtr;